var cityData=[{value:"1",text: "储蓄卡",children: [{value: "3",text: "中国农业银行"},{value: "4",text: "工商银行 "}]},{value:"2",text: "金融卡",children: [{value: "32",text: "KKK"}]}];


/*
 function children(type){
	$.ajax({
		url: urlcore + "/api/userBank/Listofbankcards?type="+type,
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success:function(data){
			if (data.success == true) {
				var cityData ='[{'+
				'"value": "1",'+
	             '"text": "储蓄卡",'+
	              'children: [';
	               $.each(data.data, function(y,n) {
	          	if (y != 0) {
	          		cityData+=",";
	          	}
                cityData+= '{"value":'+n.id+',"text":"'+n.bankName+'"}';	
              });
	        cityData+="]";
            '},{'+
	         'value: "2",'+
	          'text: "信用卡",'+
	          'children: [';
	          $.each(data.data, function(y,n) {
	          	if (y != 0) {
	          		cityData+=",";
	          	}
                cityData+= '{"value":'+n.id+',"text":"'+n.bankName+'"}';	
              });
              cityData+="]";
            '}]';
                 				alert(cityData);   
                 				
                 				var cityPicker = new $.PopPicker({
				layer: 2      //下拉框要显示几个
			});
		
			cityPicker.setData(cityData);
			var showCityPickerButton = doc.getElementById('showCityPicker');
			
			var cityResult = doc.getElementById('cityResult');
			showCityPickerButton.addEventListener('tap', function(event) {
				cityPicker.show(function(items) {
					cityResult.innerText = items[0].text + " " + items[1].text;
					//返回 false 可以阻止选择框的关闭
					//return false;
				});
			}, false);
			}
		},
		error:function() {
			/* Act on the event 
			alert("error");
		}
	});			
   }
*/


//var goodsData=//[{value:"1",text: "春季女装",children: [{value: "3",text: "公主裙"},{value: "4",text: "衬衫"},{value: "9",text: "碎花裙"},{value: "22",text: "乞丐装"},{value: "33",text: "上新"},{value: "37",text: "毛衣"}]},{value:"2",text: "上衣",children: [{value: "32",text: "卫衣"}]},{value:"7",text: "裙装",children: [{value: "5",text: "针织衫"},{value: "18",text: "小黑裙"},{value: "19",text: "小白裙"},{value: "21",text: "紫色公主裙"}]},{value:"8",text: "连衣裙",children: [{value: "11",text: "裤装"},{value: "14",text: "短裤"},{value: "20",text: "碎花洋裙"}]},{value:"36",text: "旗袍"},{value:"39",text: "夏季新款",children: [{value: "38",text: "碎花裙"}]},{value:"40",text: "秋季上新",children: [{value: "41",text: "高跟鞋"}]}];

var huoyun = [
   {
   	value: '1',
	text: '快递'
   },{
    value: '2',
	text: '货运'
   }
]


//goodsDatas();
function  goodsDatas(){
     $.ajax({
     	//async: false,
		url: urlcore + "/api/sortType/wxselectTwoList",
		type: "get",
		dataType: 'json',
		contentType: "application/json;charset=utf-8",
		success:function(data){
			if (data.success == true) {
				  goodsData+='[';
				  $.each(data.data.list,function(y,n){
				  	if(y==0){
				  	goodsData+='{value:"'+n.id+'",text: "'+n.sortName+'"';
				  	if(n.wxSortTypeList!=null){
				  		goodsData+=',children: [';
				  	 $.each(n.wxSortTypeList,function(q,m){
				  	 	   if(q==0){
				  	 	   	goodsData+='{value: "'+m.id+'",text: "'+m.sortName+'"}';
				  	 	   }else{
				  	 	   goodsData+=',{value: "'+m.id+'",text: "'+m.sortName+'"}';
				  	 	   }
				  		});
				  			goodsData+=']';
				  	}
				  	goodsData+='}';
				  	
				  	}else{
				  	goodsData+=',{value:"'+n.id+'",text: "'+n.sortName+'"';
				  	if(n.wxSortTypeList!=null){
				  		
				  		goodsData+=',children: [';
				  	 $.each(n.wxSortTypeList,function(q,m){
				  	 	   if(q==0){
				  	 	   	goodsData+='{value: "'+m.id+'",text: "'+m.sortName+'"}';
				  	 	   }else{
				  	 	   goodsData+=',{value: "'+m.id+'",text: "'+m.sortName+'"}';
				  	 	   }
				  		});
				  			goodsData+=']';
				  	}
				  		goodsData+='}';
				  	}
				  })
				   goodsData+=']';
				alert("789"+goodsData);
			//	jilian();
			}
		},
		error:function() {
			// Act on the event 
			alert("error");
		}
	});
}
